package com.wantup.miaosha.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author Zhaoluowei
 * @version 1.0
 * @date 2019/6/5 11:47
 */
public class ValidatorUtil {

    private static final Pattern MOBILE_PATTERN = Pattern.compile("1\\d{10}");

    /**
     * 验证手机号是否合法
     * @param string
     * @return
     */
    public static boolean isMobile(String string){
        Matcher matcher = MOBILE_PATTERN.matcher(string);
        return matcher.matches();
    }

    public static void main(String[] args) {
        System.out.println(isMobile("12345678900"));
    }

}
